<?php

namespace addons\mental\model;

use think\Model;


class Feedback extends Model
{

    // 表名
    protected $name = 'mental_feedback';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [];

    /**
     * Undocumented function
     * 列表
     * @return Object
     */
    public function tableList($param)
    {
        $limit = 10;
        if (isset($param['limit'])) {
            $limit = $param['limit'];
        }
        $whereArr = $this->tableWhere($param);
        return $this->field($whereArr['field'])->where($whereArr['where'])->order($whereArr['order'])->paginate($limit);
    }


    /**
     * Undocumented function
     * 统一处理查询条件
     * @param [type] $param
     * @return void
     */
    public function tableWhere($param)
    {
        $where = [];
       
        $result['where'] = $where;
        $result['field'] = "*";
        $result['order'] = [];
        return $result;
    }

}
